<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Jedrzej\Pimpable\PimpableTrait;
use Illuminate\Database\Eloquent\SoftDeletes;

class ProductAttrValue extends Model
{
    use HasFactory;
    use PimpableTrait;
    use SoftDeletes;
    /**
     * 表中的类型状态
     */
    //参与的活动类型
    public $typeTypeEnum = [
        'noActivity' => '普通商品',
        'seckill' => '秒杀',
        'bargain' => '砍价',
        'combination' => '拼团'
    ];


    /**
     * 可搜索字段
     */
    public $searchable = [
        'suk',
        'product_id'
    ];

    /**
     * 可批量赋值字段
     */
    public $fillable = [
        'suk',
        'stock',
        'sales',
        'image',
        'cost',
        'ot_price',
        'vip_price',
        'weight',
        'volume',
        'brokerage',
        'brokerage_two',
        'type',
        'quota',
        'quota_show'
    ];

    /**
     * 可排序字段
     */
    public $sortable = [
        'created_at',
        'id',
        'stock',
        'sales'
    ];

    /**
     * 默认排序字段
     */
    protected $defaultSortCriteria = ['id,desc'];

}
